<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">

    <div class="layui-card-body padding-left-40">

        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">维修时间</span>
                <span class="color-desc margin-left-5"></span>
                <input type="text" data-date-input="date" name="repairtime" value='{$vo.repairtime|format_datetime='Y-m-d'}' required placeholder="维修时间" class="layui-input" >
            </label>
            <p class="help-block"></p>
        </div>


        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">故障原因</span>
                <span class="color-desc margin-left-5"></span>
                <input name="reason" value='{$vo.reason|default=""}' required placeholder="故障原因" class="layui-input">
            </label>
            <p class="color-desc"></p>
        </div>


        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">更换配件</span>
                <span class="color-desc margin-left-5"></span>
                <input name="parts" value='{$vo.parts|default=""}' placeholder="更换配件" class="layui-input">
            </label>
            <p class="color-desc"></p>
        </div>
		
        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">维修费用</span>
                <span class="color-desc margin-left-5"></span>
                <input name="costs" value='{$vo.costs|default="-"}' placeholder="维修费用" class="layui-input">
            </label>
            <p class="color-desc"></p>
        </div>
		

        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">其他备注</span>
                <span class="color-desc margin-left-5"></span>
                 <input name="remarks" value='{$vo.remarks|default=""}' placeholder="其他备注" class="layui-input">
            </label>
            <p class="color-desc"></p>
        </div>
		
        <div class="layui-form-item">
            <label class="relative block">
                <span class="color-green font-w7">上传附件</span>
                <span class="color-desc margin-left-5"></span>
				<input name="files" id="files" class="layui-input" value="{$vo.files|default=''}" readonly>
                <button type="button" class="layui-btn layui-btn-sm" id="file_attach"><i class="layui-icon"></i>上传文件</button>
				{if $vo.files !=''}&nbsp;&nbsp;<a class="layui-btn layui-btn-sm " href="{$vo.files}" target="new">查看</a>{/if}
            </label>
            <p class="color-desc"></p>
        </div>	

    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' id="docid" name='docid'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存维修记录</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

</form>
{block name='script'}
<script>




	layui.use(['form', 'layedit', 'laydate','upload'], function(){
		  var form = layui.form
		  ,layer = layui.layer
		  ,layedit = layui.layedit
		  ,laydate = layui.laydate
		,upload = layui.upload;
		var $ = layui.jquery;
		
		upload.render({ //允许上传的文件后缀
			elem: '#file_attach'
			,url: '{:url("upload")}'
			,accept: 'file' //普通文件
			,exts: 'pdf|jpg|gif|doc|docx|zip|rar|7z|txt' //只允许上传的文件
			,done: function(res, index, upload) {
			console.log(res)
				$("#files").attr("value", res.url);
			}
		});
	});
</script>
{/block}